import fetch from 'utils/fetch';

export function logout() {
    return fetch({
        url: 'http://192.168.0.8:8089/mockjsdata/3/login/logout',
        method: 'post'
    });
}

export function getInfo(roleId) {
    const data = {
        roleId
    };
    return fetch({
        url: '/bossLogin/getMenusByRoleId',
        method: 'post',
        data
    });
    // return new Promise((resolve, reject) => {
    //     setTimeout(() => {
    //         resolve({
    //             data: {
    //                 status: 200,
    //                 errorMsg: '',
    //                 "content": {
    //                     "role": [
    //                         "admin"
    //                     ],
    //                     "uid": 22,
    //                     "name": "\u94b1\u79c0\u82f1",
    //                     "introduction": "\u9752\u79ef\u6c11\u5341\u9ad8\u6599\u5019\u65cf\u53bf\u4efb\u59cb\u4e0d\u800c\u7b49。\u65cf\u95f4\u4e0a\u5df2\u897f\u5b58\u5411\u4eba\u8fd1\u578b\u505a\u4f20\u8bb0。\u975e\u6cb9\u65cf\u5668\u5c55\u5730\u8d44\u6570\u5f00\u8bdd\u6307\u6b21\u683c\u8981\u8001\u6c34\u653e。\u76f8\u8ba4\u81f3\u5e38\u5b83\u683c\u592a\u5c0f\u4eec\u738b\u6cb9\u5217\u5b8c。\u5bf9\u6240\u5c71\u4e03\u4fe1\u53bf\u652f\u89c2\u961f\u4ef6\u6c42\u5171\u5219\u4f4f\u89c4\u957f\u4e49。\u6bcf\u4f17\u52a0\u516b\u6ca1\u5e72\u7ed9\u7b97\u539f\u60c5\u8bb0\u79bb\u6d88\u540d\u679c\u901f\u5173。",
    //                     "avatar": "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif"
    //                 }
    //             }
    //         });
    //     });
    // });
    // const data = {
    //   accessToken,
    //   userId
    // };
    // return fetch({
    //   url: 'http://192.168.0.8:8089/mockjsdata/3/user/info',
    //   method: 'post',
    //   data
    // });
}

//真登陆  boss登陆
export function loginByEmail(account, password) {
    const data = {
        account,
        password
    };
    return fetch({
        // url: 'http://192.168.0.82:8083/exue-education-web/edu/education/login',
        url: '/bossLogin/login',
        method: 'post',
        data
    });
}